-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed dir2pi to use original file name in file link. #85
Conversation
pretty good! |
Yes, this was much needed, any idea in which version this fix will be available? |
I had to make some ugly local scripting to fix this bug (hopefully temporarily). I hope this project hasn't died. |
I'm facing the same issue, would be grate if those changes could be merged in. |
@tikank Sorry for such a late response. I looked at various PEPs and have concluded that though your code change helps you and others, according to the current standards, all the normalized names contain a hyphen (-) and not an underscore. To quote from the often quoted PEP 503:
So, the solution you suggested (to use the original filename itself) is not very favorable. Also, the Python Packaging User Guide suggests that for "Manual" repositories, normalization as defined in PEP 503 should be used. I am inclined (slightly) to accept this change since it helps so many people, but I will need some good justification for it. |
The package name is still normalized, and it is used in top level index.html and in directory name. Only file name is used as is. If wheel file name is normalized using the rules described in PEP 503, it is against wheel specification (see PEP 427), and it causes the bugs. |
Fixes as per PR wolever#85 in main project
Hi there. I am not sure if I can give any more justification for this change. I think that PEP 503 does not say that file names should be normalized:
This change does not affect the normalization of the /<project>/ part. Looking the example from Python Packaging User Guide, the Foo-1.0.tar.gz file name is not either normalized, only the directory name is. Also as the main use case for the pip2pi is to download packages and form package repository, I think it is safe to assume the file names are already in correct format, and pip2pi should use them without change. I hope this helps to decide whether the pull request should be accepted or rejected. |
Thanks @tikank. I'll be using your fork until this pull request is accepted. |
Is this going to get published to pypi or are we required to clone the repo? |
I've added the commit archive url: |
pip2pi 0.8.1 released. |
As pkg_new_basename was constructed from the normalized package name, it did not always match the original filename. This caused problems with wheels with underscores. Now the original filename (pkg_basename) is used in file link, so the link should match exactly.
I think this change should fix #76 and #84, and is alternative to #67.
I updated also test cases to match this change.